
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>{$client.company_name|default=''}</title>
    <link href="/public/static/css/lb_login.css" rel="stylesheet" type="text/css" />
    <meta name="Website Design" content="技术支持：{$client.company_name|default=''}" />
    <script src="/public/static/js/jquery.min.js"></script>
    <script language="JavaScript" type="text/javascript">
       /* function addCookie(name, value, expiresHours) {
            var cookieString = name + "=" + escape(value);
            //判断是否设置过期时间
            if (expiresHours > 0) {
                var date = new Date();
                date.setTime(date.getTime + expiresHours * 3600 * 1000);
                cookieString = cookieString + "; expires=" + date.toGMTString();
            }
            document.cookie = cookieString;
        }

        function getCookie(name) {
            var strCookie = document.cookie;
            var arrCookie = strCookie.split("; ");
            for (var i = 0; i < arrCookie.length; i++) {
                var arr = arrCookie[i].split("=");
                if (arr[0] == name) return arr[1];
            }
            return "";
        }
        function deleteCookie(name) {
            var date = new Date();
            date.setTime(date.getTime() - 10000);
            document.cookie = name + "=v; expires=" + date.toGMTString();
        }*/
    </script>
    <script type="text/javascript" language=JavaScript charset="UTF-8">
        document.onkeydown = function (event) {
            var e = event || window.event || arguments.callee.caller.arguments[0];

            if (e && e.keyCode == 13) { // enter 键
                Submit(); //要做的事情
            }
        };
    </script>

    <script type="text/javascript">
       /* function refum() {
            $("#Submit").attr("onclick", "Submit()");
            //$("#ImgVerifyCode").attr("src", "/LBVerifyCode/LetterCode?datetime=" + Math.random());
        }*/

          function refreshVerify() {
              var ts = Date.parse(new Date())/1000;
              var img = document.getElementById('ImgVerifyCode');
              img.src = "{:captcha_src()}";                                 
          }


    

        function Submit() {

           /* if (getCookie("Times") != "") {
                if (parseInt(getCookie("Times")) >= parseInt(getCookie("LoginTimes"))) {
                    alert("密码错误次数太多，请" + getCookie("LoginTime") + "小时后再试");
                    return false;
                }

            }*/
            var name = $("#Name").val();
            var pwd = $("#Pwd").val();
            var lzm = $("#LZM").val();
            if (name == "") {         
                alert("请输入用户名");
                $("#Name").focus();
                return;
            }
            if (pwd == "") {
                alert("请输入密码");
                $("#Pwd").focus();
                return;
            }
            if (lzm == "" || lzm.length != 4) {
                alert("请输入正确的验证码");
                $("#LZM").focus();
                return;
            }
            $("#Submit").attr("onclick", "");
            $.ajax({
                type: "post",
                data: { "username": name, "password": pwd,"code":lzm},
                dataType: "json",
                url: "/admin/login/login",
                success: function(res){
                   if (res.status == 1) {
                        //deleteCookie("Times");
                        //deleteCookie("LoginTime");
                        //deleteCookie("LoginTimes");
                        //deleteCookie("username");
                        document.location.href = "/admin/index/index";
                    }  else{
                        alert(res.msg);
                        refreshVerify();
                    }                
                }
            });
        }

    </script>
</head>
<body>
    <div class="loginbg1">
        <div style="height:120px;"></div>
        <div class="loginbg2">
            <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="6%" height="40">&nbsp;</td>
                    <td width="84%">&nbsp;</td>
                    <td width="10%">&nbsp;</td>
                </tr>
                <tr>
                    <td height="76">&nbsp;</td>
                    <td><span style="width:100%; height:auto;display: block;text-align: center; padding: 5px 0;">
                        <img src="/uploads/client/logo/{$client.logo_img}" width="210"  /></span></td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td height="289">&nbsp;</td>
                    <td valign="top">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td height="25" colspan="3" align="right">&nbsp;</td>
                            </tr>
                            <tr>
                                <td width="18%" align="right" class="username">用户名：</td>
                                <td height="50" colspan="2">
                                    <table width="282" border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td align="center" valign="middle" class="text1"><input type="text" name="username" id="Name" style="width:270px; height:30px; border:#ffffff 0px solid;" /></td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" class="username">密　码：</td>
                                <td height="50" colspan="2">
                                    <table width="282" border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td align="center" style="position:relative;" valign="middle" class="text1">
                                                <input type="password" name="password" id="Pwd" style="width:270px; height:30px; border:#ffffff 0px solid;" />
                                               
                                                <!--  <div id="ts" style="float:left; width:290px; left:-10px; height:40px; text-align:left; padding-left:10px;  z-index:100; position:absolute; top:0;"></div> -->
                                               
                                                  
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                                    <tr>
                                                        <td align="right" class="username">验证码：</td>
                                                        <td width="24%" height="50">
                                                            <table width="140" border="0" cellspacing="0" cellpadding="0">
                                                                <tr>
                                                                    <td width="269" align="center" valign="middle" class="text2"><input type="text" name="code" id="LZM" style="width:130px; height:30px; border:#ffffff 0px solid;" /></td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                        <td width="58%">
                                                            <img id="ImgVerifyCode" src="{:captcha_src()}"  title="看不清,点击更换"
                                                                 style="border: 2px solid #ccc; cursor: pointer;" onclick="refreshVerify();" />
                                                        </td>
                                                    </tr>
                                                     <tr>
                                                       <td align="right">&nbsp;</td>
                                                       <td colspan="2">
                                                           <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                               <tr>
                                                                   <td width="27%" rowspan="2"><a id="Submit" href="#" onclick="Submit()"><div class="ok"></div></a></td>
                                                                   <td height="30" colspan="2" style="color:#006600;"></td>
                                                               </tr>
                                                            
                                                           </table>
                                                       </td>
                                                   </tr> 
                                                </table>
                                            </td>
                                                    <td>&nbsp;</td>
                                                </tr>
                                                    <tr>
                                                        <td>&nbsp;</td>
                                                        <td>&nbsp;</td>
                                                        <td>&nbsp;</td>
                                                    </tr>
                                                </table>
                                            </div>
                                                    <div class="desgin"></div>
                                                </div>
                                              </body>
                                        </html>

